package com.yanqu.road.net.operator;

import com.yanqu.road.message.YanQuMessageDecrypt;
import com.yanqu.road.message.YanQuMessageEncrypt;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class ChannelInitializerOperator {

    public static void initChannel(ChannelHandler handler, SocketChannel channel) throws Exception {
        ChannelPipeline pipeline = channel.pipeline();
        pipeline.addLast("decoder", new YanQuMessageDecrypt());
        pipeline.addLast("encoder", new YanQuMessageEncrypt());
        pipeline.addLast("handler", handler);
    }
}
